package ejb.cbm.admin.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class TransaccionSegmentoEntityId  implements java.io.Serializable {

    // Fields    
     private Long codigotransaccion;
     private Long codigosegmento;

    // Constructors

    /** default constructor */
    public TransaccionSegmentoEntityId() {
    }

    /** full constructor */
    public TransaccionSegmentoEntityId(Long codigotransaccion, Long codigosegmento) {
        this.codigotransaccion = codigotransaccion;
        this.codigosegmento = codigosegmento;
    }

    // Property accessors

    @Column(name="CODIGOTRANSACCION", unique=false, nullable=false, insertable=true, updatable=true, precision=8, scale=0)
    public Long getCodigotransaccion() {
        return this.codigotransaccion;
    }
    
    public void setCodigotransaccion(Long codigotransaccion) {
        this.codigotransaccion = codigotransaccion;
    }

    @Column(name="CODIGOSEGMENTO", unique=false, nullable=false, insertable=true, updatable=true, precision=8, scale=0)
    public Long getCodigosegmento() {
        return this.codigosegmento;
    }
    
    public void setCodigosegmento(Long codigosegmento) {
        this.codigosegmento = codigosegmento;
    }

   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof TransaccionSegmentoEntityId) ) return false;
		 TransaccionSegmentoEntityId castOther = ( TransaccionSegmentoEntityId ) other; 
         
		 return ( (this.getCodigotransaccion()==castOther.getCodigotransaccion()) || ( this.getCodigotransaccion()!=null && castOther.getCodigotransaccion()!=null && this.getCodigotransaccion().equals(castOther.getCodigotransaccion()) ) )
 && ( (this.getCodigosegmento()==castOther.getCodigosegmento()) || ( this.getCodigosegmento()!=null && castOther.getCodigosegmento()!=null && this.getCodigosegmento().equals(castOther.getCodigosegmento()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( getCodigotransaccion() == null ? 0 : this.getCodigotransaccion().hashCode() );
         result = 37 * result + ( getCodigosegmento() == null ? 0 : this.getCodigosegmento().hashCode() );
         return result;
   }   
}